const express = require('express');
const router = express.Router();
const jobIntentionController = require('../controllers/jobIntention.controller');
const { authenticate, authorize } = require('../middleware/auth');

// 求职者路由 - 需认证和求职者权限
router.use(authenticate);

// 求职者管理自己的求职意向
router.post('/', authorize('job_seeker'), jobIntentionController.upsertJobIntention);
router.get('/my-intention', authorize('job_seeker'), jobIntentionController.getMyJobIntention);
router.delete('/', authorize('job_seeker'), jobIntentionController.deleteJobIntention);

// 管理员路由 - 获取所有求职意向
router.get('/', authorize('admin'), jobIntentionController.getAllJobIntentions);

module.exports = router;